package com.yangjiangtao.ioc;

public class Director {
    public void direct_1(){
        // 接口注入方法实现角色注入
        GeLi geli = new LiuDeHua();
        MoGong moGong = new MoGong();
        moGong.injectGeli(geli);
        moGong.cityGateAsk();
    }

    public void direct_2(){
        // 构造函数方法注入角色
        GeLi geli = new LiuDeHua();
        MoGong moGong = new MoGong(geli);
        moGong.cityGateAsk();
    }

    public void direct_3(){
        // 接口注入方法实现角色注入
        GeLi geli = new LiuDeHua();
        MoGong moGong = new MoGong();
        moGong.injectGeli(geli);
        moGong.cityGateAsk();
    }
}
